<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    
    <meta http-equiv="content-language" content="zh-CN" />
    

    
    <meta name="viewport" content="width=device-width, initial-scale=0.5">
    

    
    <title>hugo--blogdown生成的目录</title>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.8/clipboard.min.js"></script>
    
    
    
    
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css">

    
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap-theme.min.css">

    <link rel="stylesheet" href="/css/stylesheet.css">
    <link rel="stylesheet" href="/css/home.css">

    
    
        <style type="text/css">
        body { background-color: #fbf6ec;}
        </style>
    
    
                
        
        
            <link rel="stylesheet" href="/css/main.css"/>
        




        
        
        
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.3.2/styles/github.min.css"  />
         
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.3.2/highlight.min.js"></script>
        
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.3.2/languages/r.min.js"></script>
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.3.2/languages/yaml.min.js"></script>
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.3.2/languages/latex.min.js"></script>
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.3.2/languages/matlab.min.js"></script>
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.3.2/languages/mathematica.min.js"></script>
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.3.2/languages/julia.min.js"></script>
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.3.2/languages/julia-repl.min.js"></script>
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.3.2/languages/powershell.min.js"></script>
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.3.2/languages/bash.min.js"></script>
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.3.2/languages/shell.min.js"></script>
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.3.2/languages/python.min.js"></script>
        
        <script>hljs.initHighlightingOnLoad();</script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
          
     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css" integrity="sha512-+4zCK9k+qNFUR5X+cKL9EIR+ZOhtIloNl9GIKS57V1MyNsYpYcUrUeQc9vNfzsWfV28IaLL3i96P9sdNyeRssA==" crossorigin="anonymous" />
     
     
</head>


<body>
    <script>
        window.addEventListener("resize", resizeThrottler, false);

        var resizeTimeout;
        function resizeThrottler() {
        
        if ( !resizeTimeout ) {
            resizeTimeout = setTimeout(function() {
            resizeTimeout = null;
            actualResizeHandler();
        
            
            }, 66);
        }
        }
        actualResizeHandler()
        function actualResizeHandler() {
                if (/mobile/i.test(navigator.userAgent) || /android/i.test(navigator.userAgent))
                {
                    document.body.classList.add('mobile');
                }else{
                    document.body.classList.remove('mobile');  
                }
    }</script>

    
      
      
            <nav class="navbar navbar-default navbar-static-top" style="opacity: .9" role="navigation">
        <div class="container-fluid">
            
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">

                    <span class="sr-only">Toggle navigation</span>
                    <span class="big-icon icon-bar"></span>
                    <span class="big-icon icon-bar"></span>
                    <span class="big-icon icon-bar"></span>

                </button>
                <a class="navbar-brand" href="/">zsc</a>
            </div>

            <div class="navbar-collapse collapse" id="bs-example-navbar-collapse-1" style="height: auto;">
                <ul class="nav navbar-nav navbar-right" style="font-size: 100%">
                    
                        
                            
                            <li class=""><a href="/about/">About</a></li>
                            
                            <li class=""><a href="/categories/">Categories</a></li>
                            
                            <li class=""><a href="/">Home</a></li>
                            
                            <li class=""><a href="/tags/">Tags</a></li>
                            
                            <li class=""><a href="/issue/">存在的问题</a></li>
                            
                        
                    
                </ul>
            </div>
        </div>
    </nav>










<div class="inner">
    



    <div class="blog-post">
        
                <div>
            <h2 align="center" id = "singe-h2">
                hugo--blogdown生成的目录
                <time>
                    <br>
                    <span> 
                        <i class="fa fa-user-edit" style="color:#888;font-size: 80%;"></i>
                        zsc 
                    </span>
                    &nbsp 
                    <span>                 
                        <i class="fa fa-calendar-alt" style="color:#888;font-size: 80%;"></i>
                        2017-12-30 
                    </span>
                </time>
                
                
                <div>
                    <ul class="tags">
                        
                        <span>标签:</span>
                        <li><a class="link" href="/tags/hugo"> #hugo </a></li>
                        
                        <span> </span>
                        
                    </ul>
                    
                </div>
            </h2>
        </div>
    
        
        <section id="content">
            <h4 id="1先介绍一下有hugo生成的目录">1、先介绍一下有hugo生成的目录</h4>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-R" data-lang="R"><span style="display:flex;"><span>站点下面的目录和必须的文件由hugo自己生成。一般它是这样的：
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>archetypes<span style="color:#f92672">/</span>                 <span style="color:#f92672">:</span> 全局原型，也就是内容模板。
</span></span><span style="display:flex;"><span><span style="color:#f92672">|</span>____default.md             <span style="color:#f92672">:</span> 默认的内容模板，你可以设置好文件头部分，或者为不同的类型设置模板
</span></span><span style="display:flex;"><span>content<span style="color:#f92672">/</span>                    ：内容，存放“XXX.md”<span style="color:#f92672">/</span><span style="color:#e6db74">&#34;XXX&gt;Rmd&#34;</span>文件，文件名可以用中文
</span></span><span style="display:flex;"><span>data<span style="color:#f92672">/</span>                       ：存放数据文件
</span></span><span style="display:flex;"><span>layouts<span style="color:#f92672">/</span>                    ：和archetypes一起将被我们的主题覆盖掉
</span></span><span style="display:flex;"><span>public<span style="color:#f92672">/</span>                     ：生成目录，所有的静态页面都在这里，上传服务器仅传这个就行。
</span></span><span style="display:flex;"><span>static<span style="color:#f92672">/</span>                     ：静态目录，完全复制到public。比如图片、js、php脚本
</span></span><span style="display:flex;"><span>themes<span style="color:#f92672">/</span>                     ：主题目录，一个站可有多个主题，就像换衣服
</span></span><span style="display:flex;"><span><span style="color:#f92672">|</span>____aaa                    ：主题aaa，可以有很多个
</span></span><span style="display:flex;"><span><span style="color:#f92672">|</span>____bbb                    ：主题bbb
</span></span><span style="display:flex;"><span>     <span style="color:#f92672">|</span>____archetypes        <span style="color:#f92672">:</span> 主题的内容模板
</span></span><span style="display:flex;"><span>     <span style="color:#f92672">|</span>____layouts           ：布局，就是html模板
</span></span><span style="display:flex;"><span>     <span style="color:#f92672">|</span>____static            ：静态的，放主题的js，css文件
</span></span><span style="display:flex;"><span>     <span style="color:#f92672">|</span>____LICENSE.md        ：这个，呵呵，不说大家也知道
</span></span><span style="display:flex;"><span>     <span style="color:#f92672">|</span>____theme.toml        ：主题的信息配置
</span></span><span style="display:flex;"><span>config.toml                 ：站点配置文件，可以配置站点名字等等很多信息
</span></span></code></pre></div><p>主题部分并未全部介绍，这个将在主题部分详细讲解。</p>
<h4 id="2静态文件">2、静态文件</h4>
<p>不需要hugo处理的文件叫做静态文件。存放在 <strong>站点的static</strong> 目录是个好主意。</p>
<blockquote>
<p>static目录下的文件将会原封不动的复制到public下面，比如您建立了个img的目录存图片，在md文件中将直接使用”img/aaa.jpg”来引用图片，</p>
<p>特别的，如果您的站点有php等脚本运用，和一些其他的文件，比如各搜索引擎的验证文件等，也可以放在这里。不建议直接将文件存放于public目录，因为我习惯不高兴就删了全来！相信你也会有不高兴的时候的。（后面比如要上传的google网站分析的html文件）</p>
</blockquote>
<h4 id="3站点配置文件">3、站点配置文件</h4>
<p>站点根目录下有一个”config.toml“就是配置文件  <code>E:\test_blog</code>下的config.toml</p>
<h5 id="信息存在的地hugo有三个地方可以放信息">信息存在的地，hugo有三个地方可以放信息，</h5>
<ul>
<li>一个是站点的配置文件“config.toml”，</li>
<li>一个是我们文章文件md文件的头部（默认的用三个“&mdash;”号开始和结束，也可以用三个“+++”号</li>
<li>最后一个是“data”数据目录。</li>
</ul>
<p>congfig.toml该文件默认支持的<a href="http://www.zimustudio.com/hugo/hugopeizhi.html">全部参数</a>：可以用键值对，也可以用赋值语句</p>
<p>以 hugo-lithium-theme主题为例</p>
<p>介绍几个后面可能会用的参数</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-toml" data-lang="toml"><span style="display:flex;"><span><span style="color:#a6e22e">baseurl</span> = <span style="color:#e6db74">&#34;http://qaz.netlify.com&#34;</span>    <span style="color:#75715e"># 基础路径,当自己有网站的时候就写自己的</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">relativeurls</span> = <span style="color:#66d9ef">true</span>                    <span style="color:#75715e">#使用想对路径方便本地浏览</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">languageCode</span> = <span style="color:#e6db74">&#34;zh-cn&#34;</span>                <span style="color:#75715e">#编码</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">title</span> = <span style="color:#e6db74">&#34;A Hugo website&#34;</span>			<span style="color:#75715e">#网站的title</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">theme</span> = <span style="color:#e6db74">&#34;hugo-lithium-theme&#34;</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">googleAnalytics</span> = <span style="color:#e6db74">&#34;&#34;</span>                 <span style="color:#75715e">#谷歌网站分析添加自己的id，形如：UA-XXXXXX-X</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">disqusShortname</span> = <span style="color:#e6db74">&#34;http-qaz-netlify-com&#34;</span>  <span style="color:#75715e"># disqusShortname 的名字，一定要找准</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">ignoreFiles</span> = [<span style="color:#e6db74">&#34;\\.Rmd$&#34;</span>, <span style="color:#e6db74">&#34;\\.Rmarkdown$&#34;</span>, <span style="color:#e6db74">&#34;_files$&#34;</span>, <span style="color:#e6db74">&#34;_cache$&#34;</span>] 
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">hasCJKLanguage</span> = <span style="color:#66d9ef">true</span>         <span style="color:#75715e">#若要统计中文字数设置为ture,默认统计英文</span>
</span></span></code></pre></div><h4 id="4自定义信息">4、自定义信息</h4>
<p>站点配置文件并不是只能存放默认的配置项目的，它一样可以存放自定义的数据，并且在模版中被调用。</p>
<p>下面是本站的目录的自定义信息：</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-toml" data-lang="toml"><span style="display:flex;"><span>[<span style="color:#a6e22e">permalinks</span>]
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">post</span> = <span style="color:#e6db74">&#34;/:year/:month/:day/:slug/&#34;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>[[<span style="color:#a6e22e">menu</span>.<span style="color:#a6e22e">main</span>]]
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">name</span> = <span style="color:#e6db74">&#34;About&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">url</span> = <span style="color:#e6db74">&#34;/about/&#34;</span>
</span></span><span style="display:flex;"><span>[[<span style="color:#a6e22e">menu</span>.<span style="color:#a6e22e">main</span>]]
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">name</span> = <span style="color:#e6db74">&#34;GitHub&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">url</span> = <span style="color:#e6db74">&#34;https://github.com/rstudio/blogdown&#34;</span>
</span></span><span style="display:flex;"><span>[[<span style="color:#a6e22e">menu</span>.<span style="color:#a6e22e">main</span>]]
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">name</span> = <span style="color:#e6db74">&#34;Twitter&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">url</span> = <span style="color:#e6db74">&#34;https://twitter.com/rstudio&#34;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>[<span style="color:#a6e22e">params</span>]
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">description</span> = <span style="color:#e6db74">&#34;A website built through Hugo and blogdown.&#34;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e"># options for highlight.js (version, additional languages, and theme)</span>
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">highlightjsVersion</span> = <span style="color:#e6db74">&#34;9.11.0&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">highlightjsCDN</span> = <span style="color:#e6db74">&#34;//cdn.bootcss.com&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">highlightjsLang</span> = [<span style="color:#e6db74">&#34;r&#34;</span>, <span style="color:#e6db74">&#34;yaml&#34;</span>]
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">highlightjsTheme</span> = <span style="color:#e6db74">&#34;github&#34;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">MathJaxCDN</span> = <span style="color:#e6db74">&#34;//cdn.bootcss.com&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">MathJaxVersion</span> = <span style="color:#e6db74">&#34;2.7.1&#34;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    [<span style="color:#a6e22e">params</span>.<span style="color:#a6e22e">logo</span>]
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">url</span> = <span style="color:#e6db74">&#34;logo.png&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">width</span> = <span style="color:#ae81ff">50</span>
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">height</span> = <span style="color:#ae81ff">50</span>
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">alt</span> = <span style="color:#e6db74">&#34;Logo&#34;</span>
</span></span></code></pre></div><p>找到<code>E:\test_blog\themes\hugo-lithium-theme\layouts\</code> 下面有两个文件夹</p>
<p>一个<code>_default/</code> <code> partials/</code></p>

        </section>
    </div>
    <br>
    
    




<span id="/md/2017-12-30-hugo---blogdown%E7%94%9F%E6%88%90%E7%9A%84%E7%9B%AE%E5%BD%95/" class="leancloud_visitors" data-flag-title="hugo--blogdown生成的目录">
  <span class="post-meta-item-text">文章总阅读量 </span>
  <span class="leancloud-visitors-count"><i class="leancloud-visitors-count"></i></span>次;
  <p></p>
</span>



    

    
    
    <button id="edit-button" class="icon-button" type="button" title="Fork and edit" aria-label="Fork and edit" aria-haspopup="true" aria-expanded="false" aria-controls="edit">
        <i class="fa fa-edit">编辑本文</i>
    </button>
    
    
    

    <br>
    <hr>
    <li style="float:left;list-style:none">
        
        <a class="previous" href="/md/2017-12-30-hugo---%E5%88%86%E7%B1%BB%E6%A0%87%E7%AD%BE%E6%B7%BB%E5%8A%A0/"> 上一篇: hugo--分类标签添加</a>
        
    </li>
    <li style="float:right;list-style:none">
        
        <a class="next" href="/md/2017-12-31-tibble%E5%8C%85%E7%9A%84%E5%88%97-%E8%A1%8C%E5%90%8D%E8%BD%AC%E6%8D%A2/"> 下一篇: tibble包的列和行名相互转换以及添加行和列</a>
        
    </li>
     
    
    <script src="/js/copyCode.js"></script>
    <script src="/js/tooltips.js"></script>
    
   
    <script>
    [].slice.call(document.querySelectorAll('table')).forEach(function(el) {
        var wrapper = document.createElement('div');
        wrapper.className = 'table-area';
        el.parentNode.insertBefore(wrapper, el);
        el.parentNode.removeChild(el);
        wrapper.appendChild(el);
        $("table").wrap("<div class='table-area'></div>");
    })
    </script>

    
<br>
<hr>


<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-111691389-1"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag() { dataLayer.push(arguments); }
  gtag('js', new Date());

  gtag('config', 'UA-111691389-1');
</script>




      
      
      

       
      
      
      <script>
              document.getElementById("edit-button").addEventListener("click", function () {
                  var editWindow = window.open("https:\/\/github.com\/zoushucai\/blogmmm/edit/master/content/md\/2017-12-30-hugo ---blogdown生成的目录.md");
              });</script>
      
          




<script>
  function resizeIframe(obj) {
    obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
  } 
</script>



    </style>
    <script type="text/javascript">
    function showdiv(){
        document.getElementById("divtocTableOfContents").style.display="block";
        document.getElementById("strHref").innerHTML="目录收起-";
        document.getElementById('divTableOfContents').style.width="22%";
        document.getElementById('divTableOfContents').style.height="55%";
        document.getElementById('divTableOfContents').style.top="25%";
        document.getElementById('divTableOfContents').style.bottom="5%";
        document.getElementById("strHref").href="javascript:hidediv()";
    }
    function hidediv(){
        document.getElementById("divtocTableOfContents").style.display="none";
        document.getElementById("strHref").innerHTML="目录展开+";
        document.getElementById("strHref").href="javascript:showdiv()";
        document.getElementById('divTableOfContents').style.width="10%";
        document.getElementById('divTableOfContents').style.height="5%";
    }
    </script>
</body>

</html>
</div> 







    <script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/mathtex-script-type.min.js" integrity="sha384-LJ2FmexL77rmGm6SIpxq7y+XA6bkLzGZEgCywzKOZG/ws4va9fUVu2neMjvc3zdv" crossorigin="anonymous"></script>

    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css">
    <script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.js"></script>
    <script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/auto-render.min.js"></script>
    <script>
        document.addEventListener("DOMContentLoaded", function() {
            renderMathInElement(document.body, {
            delimiters: [
                            {left: "$$", right: "$$", display: true},
                            {left: "$", right: "$", display: false},
                            {left: "\\(", right: "\\)", display: false},
                            {left: "\\[", right: "\\]", display: true}
                        ]
            });
        });
    </script>













<br>
<div class="inner">
              
            
          
          
  
          
  
  <div id="vcomments"></div>
  
  <script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
  
  <script src='//unpkg.com/valine/dist/Valine.min.js'></script>
  <script type="text/javascript">
    new Valine({
        el: '#vcomments' ,
        appId: 'HfHPKPkLa0cBEDPcdBAHuqMv-gzGzoHsz',
        appKey: 'r5RJAasN8e0mB9sq6y9pEcX0',
        lang:'zh-CN',
        notify:  false , 
        verify:  false  ,
        avatar:'identicon', 
        placeholder: '说点什么吧...',
        visitor:  true 
    });
  </script>

</div>

<br>
<br>
<footer>
    <p style="float:right;margin-right: 5%;margin-top: 0%;">
        &copy; 2022 <a href="https://github.com/zoushucai">zsc</a>
      </p>
</footer>
<br>
<br>


